﻿@model JSonTest.Items

@{
    ViewBag.Title = "Edit";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>@ViewBag.Title @Model.item_name</h2>


@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    
    <div class="form-horizontal">
        <hr />
        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
        @Html.HiddenFor(model => model.item_id)

        <div class="form-group">
            @Html.LabelFor(model => model.item_name, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.item_name, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.item_name, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.item_unit, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.item_unit, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.item_unit, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.item_quantity, htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.EditorFor(model => model.item_quantity, new { htmlAttributes = new { @class = "form-control" } })
                @Html.ValidationMessageFor(model => model.item_quantity, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.order_number, "order_number", htmlAttributes: new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.DropDownList("order_number", null, htmlAttributes: new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.order_number, "", new { @class = "text-danger" })
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
	            @*<input type="submit" value="Save" class="btn btn-default" />*@
								<button type="submit" value="Save" class="btn btn-success"><span class="glyphicon glyphicon-save">&nbsp;</span>Save</button>
            </div>
        </div>
    </div>
}

<div>
    @*@Html.ActionLink("Back to List", "Items", "Home")*@
		<a href="@Url.Action("Items", "Home")" class="btn btn-primary"><span class="glyphicon glyphicon-arrow-left">&nbsp;</span>Back to List</a>

</div>
